package cn.chinaunicom.kafka.controller;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author xuwenyuan
 * @date 2020/2/16 17:49
 * @description
 */

@Controller
@ResponseBody
public class ConsumerController {

    @KafkaListener(topics = "mysons")
    public void onMessage(String message){
        System.out.println("消息收到成功：" + message);
    }


}
